import {connect} from 'react-redux'
import TopList from '../components/view/range/top_LIst'
import {getTopList} from '../actions/TopListAction'
import {getTopListDetail} from '../api/index'
//1.映射组件
const mapStateToProps = (state)=>{
    return{
        info: state.top_listRender.info
    }
}
//2.映射dispatch
const mapDispatchToProps=(dispatch)=>{
    return{
        //定义一个方法 此方法会垂直映射到product的ui组件上      
        topList(){
            dispatch(getTopList())
        },
        topListDetail(id){
           return getTopListDetail(id)
        }

    }
}
//通过connect将state和dispatch通过props属性垂直映射到ul组件
let RangeContainer=connect(mapStateToProps,mapDispatchToProps)(TopList)
export default RangeContainer